import axios from 'axios'
export const getswiper = (data) => {
  return axios.get('/m5/home/multidata');
}
export const getlist = (type, page) => {
  return axios({
    url: '/m5/home/data',
    params: {
      type,
      page
    }
  })
}
// detail 数据
export const getdetail = (id) => {
  return axios(`/m5/detail?iid=${id}`)
}
export class goods {
  constructor(iteminfo, columns, services) {
    this.title = iteminfo.title; //商品描述信息
    this.price = iteminfo.price;//商品价格
    this.oldPrice = iteminfo.oldPrice;//原价
    this.discountDesc = iteminfo.discountDesc;//折扣信息
    this.columns = columns;//销量
    this.services = services;// 延误必赔
    this.iteminfo = iteminfo
  }
}
// recommend 热门推荐图片数据
export const recommend = () => {
  return axios(`/m5/recommend`)
}

export const category = () => {
  return axios(`/m5/category`)
}

export const subcategory = (id) => {
  return axios(`/m5/subcategory?maitKey=${id}`)
}
export const miniWallkey = (id2,type) => {
  return axios(`/m5/subcategory/detail?miniWallkey=${id2}&type=${type}`)
}
